//
// Created by yunnan xu on 2020/11/18.
//

#ifndef ANDROIDGRAPHICSDEMOS_GLESUTILS_H
#define ANDROIDGRAPHICSDEMOS_GLESUTILS_H


enum class GraphicsAPI
{
    GLESv3,
    Vulkan
};


void TryGetGLError(const char * tag);

#define GL_CHECK(x)                                                                              \
        x;                                                                                           \
        {                                                                                            \
            GLenum glError = glGetError();                                                           \
            if(glError != GL_NO_ERROR) {                                                             \
                LOGE("glGetError() = %i (0x%.8x) at %s:%i\n", glError, glError, __FILE__, __LINE__); \
                exit(1);                                                                             \
            }                                                                                        \
        }

#endif //ANDROIDGRAPHICSDEMOS_GLESUTILS_H
